package com.caesar.method_son;

import com.caesar.method_fa.Graphic;

/**
 * @author caesar
 * @date 2025/7/9
 * @Description:
 * @apiNote
 */
public class Circle extends Graphic {
    private double radius;//半径

    public Circle() {
    }

    public Circle(double radius) {
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    @Override
    public double area() {
        return Math.PI * radius * radius;
    }

    @Override
    public double perimeter() {
        return 2 * Math.PI * radius;
    }

    @Override
    public String toString() {
        return "圆的半径为：" +radius +
                super.toString();
    }
}
